package com.example.reidsdemo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.example.dubbodemo.server.ServerOne;
import com.example.reidsdemo.annotation.MyAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class RedisController {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Reference
    private ServerOne serverOne;

    @GetMapping ("/dubboSyn")
    public void dubboSyn() throws InterruptedException {
        stringRedisTemplate.opsForValue().set("key","1");
        System.out.println(serverOne.test1());
    }

    @GetMapping ("/test")
    @MyAnnotation
    public String test()  {
        return "test()";
    }

}
